Skip to content

Retry connecting to MySQL for a while instead of failing the run. Fix… - #448

Merged
tomrittervg merged 1 commit into
masterfrom
2026-11-03-tjr-mysql-connect-retry
Nov 3, 2026
Merged

tomrittervg merged 1 commit into
masterfrom
2026-11-03-tjr-mysql-connect-retry

Conversation

@tomrittervg

Copy link
Copy Markdown
Collaborator

…es #168

On Taskcluster, run.py starts cloud_sql_proxy and only waits two seconds to see whether it crashes, so Updatebot sometimes tries to connect before the proxy is listening and the whole run fails with "Connection refused". Retry the connection for about half a minute.

#168

On Taskcluster, run.py starts cloud_sql_proxy and only waits two seconds to
see whether it crashes, so Updatebot sometimes tries to connect before the
proxy is listening and the whole run fails with "Connection refused". Retry
the connection for about half a minute.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the MySQL connection-retry change.

No open issues 🎉

What changed in this PR

Adds MySQL connection retries to tolerate cloud_sql_proxy startup delays on Taskcluster, addressing the connection-refused failure reported in #168.

Changes:

  • Wraps MySQL connection creation with six attempts and exponential backoff, allowing roughly half a minute for startup.
  • Adds a regression test that simulates two refused connections before successfully connecting and checking database usability.
File Description
tests/​database.py Tests recovery from initial connection failures without waiting between attempts.
components/​db.py Extracts connection creation into a retry-enabled helper used during initialization.

Review effort: Balanced

@tomrittervg
tomrittervg merged commit d6fc8f4 into master Nov 3, 2026
17 checks passed
@tomrittervg
tomrittervg deleted the 2026-11-03-tjr-mysql-connect-retry branch November 3, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants